﻿@{
    ViewBag.Title = "AddSecond";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>AddSecond</h2>
<table>
    <tr>
        <td>添加第二类别名称为：<input id="Text1" type="text" /></td>
    </tr>
    <tr>
        <td><input id="Button1" type="button" value="添加" onclick="Add()" /></td>
    </tr>
</table>
<script>
    function Add() {
        var name = $("#Text1").val();
        var Fid=@ViewBag.Fid;
        $.ajax({
            url:"/Home/AddSecond_Add",
            type:"post",
            data:{
                id:Fid,
                name:name
            },
            success:function(data){
                if(data=="1")
                {
                    alert('添加成功');
                    location.href="/Home/SecondTypeShow/"+Fid+"";
                }
            }
        })
    }
</script>